package eraserhead.xml.request;

import xml.Message;
import client.ServerAccess;

/**
 * Class for sending a Report request.
 * @author Michael Checca
 */
public class ReportRequest {
	/**
	 * Sends a ReportRequest to the server.
	 * @param sa {@link ServerAccess} to send request the {@link Message to}
	 * @param key Admin key
	 * @param type Type of event to get report for (open or closed)
	 */

	public static void send(ServerAccess sa, String key, String type) {
		String xmlMessage = String.format("%s<reportRequest key=\"%s\" type=\"%s\"/></request>",
				Message.requestHeader(), key, type);
		sa.sendRequest(new Message(xmlMessage));
	}
}
